package behavior.ChainOfResponsibility;

import java.math.BigDecimal;

/**
 * Created by LYJ on 2016/10/20.
 * 具体处理角色 总经理
 */
public class GeneralHandler extends ConsumeHandler {
    @Override
    public void doHandler(String user, BigDecimal free) {
        if (5000 <= free.doubleValue()){
            if("zzh".equals(user))
                System.out.println(user+" 报销不通过");
            else
                System.out.println(user+" 给予报销 "+free);
        }
        else {
            if (null != getNextHandler()){
                getNextHandler().doHandler(user,free);
            }
        }
    }
}
